<template>
  <NstdButton plain @click="dialogVisible = true">
    Click to open the Dialog
  </NstdButton>

  <el-dialog
      v-model="dialogVisible"
      title="Tips"
      width="500"
      :before-close="handleClose"
  >
    <span>This is a message</span>
    <template #footer>
      <div class="dialog-footer">
        <NstdButton @click="dialogVisible = false">Cancel</NstdButton>
        <NstdButton type="primary" @click="dialogVisible = false">
          Confirm
        </NstdButton>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const dialogVisible = ref(false)

const handleClose = () => {
  dialogVisible.value = false
}
</script>
